/**
*		@file Calls.h
*		@brief Calls class
*
*		@author Lan Ziquan
*
*		@date 1/25/2012
*/ 
#ifndef CALLS_H
#define CALLS_H

#include "ProcTable.h"
#include "Utility.h"
#include <queue>

class Calls{
public:
	/**
	*		This method will transform a vector structure to a matrix structure
	*/
	static void		RebuildCalls();

	static void		CompleteCalls();

	/**
	*		This method will get ProcSet of p, such that Calls(proc_idx_left, p)
	*/
	static ProcSet&	GetCallsRight(ProcIdx proc_idx_left);

	/**
	*		This method will get ProcSet of p, such that Calls(p, proc_idx_right)
	*/
	static ProcSet&	GetCallsLeft(ProcIdx proc_idx_right);
	
	/**
	*		This method will get ProcSet of p, such that Calls*(proc_idx_left, p)
	*/
	static ProcSet&	GetCallsAdvRight(ProcIdx proc_idx_left);

	/**
	*		This method will get ProcSet of p, such that Calls*(p, proc_idx_right)
	*/
	static ProcSet&	GetCallsAdvLeft(ProcIdx proc_idx_right);
	
	/**
	*		This method will check if Calls(proc_idx_left, proc_idx_right)
	*/
	static bool		IsCalls(ProcIdx proc_idx_left, ProcIdx proc_idx_right);
	
	/**
	*		This method will check if Calls*(proc_idx_left, proc_idx_right)
	*/
	static bool		IsCallsAdv(ProcIdx proc_idx_left, ProcIdx proc_idx_right);

private:
	static vector<ProcSet>	calls_table_;
	static vector<ProcSet>	calls_table_t_;
	static vector<ProcSet>	calls_adv_table_;
	static vector<ProcSet>	calls_adv_table_t_;

	static ProcSet			calls_has_p0_;	//calls(p,_),calls*(p,_)
	static ProcSet			calls_has_0p_;	//calls(_,p),calls*(_,p)
	static bool				calls_has_00_;	//calls(_,_),calls*(_,_)
};

#endif
